//
//  Tools.h
//  Time
//
//  Created by SCB on 16/6/23.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import <Foundation/Foundation.h>

@import UIKit;

#define IMAGE(IMAGENAME, IMAGETYPE) [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:(IMAGENAME) ofType:(IMAGETYPE)]]

#define LEFTBAR [[UIBarButtonItem alloc] initWithImage:[IMAGE(@"btn_nav_back", @"png") imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStyleDone target:self action:@selector(leftBarAction:)]

#define RIGHTBAR [[UIBarButtonItem alloc] initWithImage:[IMAGE(@"btn_nav_share", @"png") imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStyleDone target:self action:@selector(rightBarAction:)]

#define FONT [UIFont systemFontOfSize:16]

@interface Tools : NSObject


+ (NSDate *)returnDate:(NSString *)string;
+ (NSString *)returnString:(NSDate *)date;

+ (CGFloat)getTextHeight:(NSString *)text withWidth:(CGFloat)width withFontSize:(NSInteger)size;
+ (CGFloat)getImageHeight:(NSString *)imageName withWidth:(CGFloat)width;
+ (CGFloat)getTextWidth:(NSString *)text withFontSize:(NSInteger)size;

@end
